SimpleController = function(gameObject) {
    Controller.call(this,gameObject);
};

SimpleController.prototype = Object.create(Controller.prototype);

SimpleController.prototype.run = function() {
    x = this.gameObject.x;
    if (input.left) {
        this.gameObject.vx = -4;
        if (this.gameObject.currAnimationName != "walk_h") {
            this.gameObject.animation.gotoAndPlay("walk_h");
            this.gameObject.currAnimationName = "walk_h";
        }
        this.gameObject.facingRight = false;
    } else if (input.right) {
        this.gameObject.vx = 4;
        if (this.gameObject.currAnimationName != "walk") {
            this.gameObject.animation.gotoAndPlay("walk");
            this.gameObject.currAnimationName = "walk";
        }
        this.gameObject.facingRight = true;
    } else {
        this.gameObject.vx = 0;
        if (this.gameObject.facingRight) {
            if (this.gameObject.currAnimationName != "idle") {
                this.gameObject.animation.gotoAndPlay("idle");
                this.gameObject.currAnimationName = "idle";
            }
        } else {
            if (this.gameObject.currAnimationName != "idle_h") {
                this.gameObject.animation.gotoAndPlay("idle_h");
                this.gameObject.currAnimationName = "idle_h";
            }
        }
    }

    this.gameObject.move(this.gameObject.vx, 0);
};//run
